<template>
  <view class="">
    <u-popup :customStyle="{ background: 'transparent' }" :safeAreaInsetBottom="false" :show="isShow" mode="center"
             @close="close">
      <view class="wrap">
        <image class="close" mode=""
               src="https://travel20231111.oss-cn-hangzhou.aliyuncs.com/image/close.png" @click="close"></image>
        <view class="content flex">
          <image :src="`https://travel20231111.oss-cn-hangzhou.aliyuncs.com/image/suc.png`" class="img"
                 mode=""></image>
          <view class="tips">
            {{ content }}
          </view>
          <image class="btn" src="https://travel20231111.oss-cn-hangzhou.aliyuncs.com/image/ckxcbg-btn.png"
                 @click="toPath"></image>
        </view>
      </view>
    </u-popup>
  </view>
</template>
<script>
export default {
  data() {
    return {
      isShow: false,
      phone: null,
    };
  },
  onload() {
    // this.phone = uni.getStorageSync('userinfo').phone;
  },
  props: {
    obj: {
      type: Object,
      default: {},
    },
    result: {
      type: String,
      default: "fail",
    },
    content: {
      type: String,
      default: "提交成功",
    },
    delta: {
      type: Number,
      default: 1,
    },
  },
  methods: {
    toUrl(url) {
      if (!url) return;
      uni.navigateTo({
        url,
      });
    },
    toPath() {
      // uni.setStorageSync("makeInfo", {
      //   itineraryId: this.obj.itineraryId,
      //   partyId: this.obj.partyId,
      //   phone: this.obj.phone,
      //   groupId: this.obj.groupId,
      //   proposalId: this.obj.proposalId,
      // });
      // uni.navigateTo({
      //   url: `/pages/challenge/make`,
      // });
      uni.navigateTo({
        url: '/pages/tourplan/travelReport/travelReport?itineraryId=' + this.obj.itineraryId +
            '&partyId=' + this.obj.partyId + '&groupId=' + this.obj.groupId + "&returnType=" + this.obj
                .returnType + '&deltaNumber=' + this.obj.deltaNumber
      })
    },
    show() {
      this.isShow = true;
    },
    close() {
      this.isShow = false;
      uni.navigateBack({
        delta: this.delta,
      });
    },
    submit() {
      this.close();
      this.$emit("next", {
        result: this.result,
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.wrap {
  width: 670rpx;
  padding: 30rpx 0 40rpx;
  box-sizing: border-box;
  background: url("https://travel20231111.oss-cn-hangzhou.aliyuncs.com/image/modal-bg-h.png");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;

  .close {
    position: absolute;
    width: 80rpx;
    height: 80rpx;
    top: 0;
    right: 0;
  }
}

.content {
  width: 550rpx;
  background: url("https://travel20231111.oss-cn-hangzhou.aliyuncs.com/image/modal-bg-b.png");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 60rpx 40rpx 90rpx;
  flex-direction: column;

  .img {
    width: 140rpx;
    height: 140rpx;
    margin-bottom: 50rpx;
  }

  .tips {
    font-size: 45rpx;
    font-weight: 400;
    letter-spacing: 0pt;
    line-height: 65.16rpx;
    color: rgba(0, 0, 0, 1);
    text-align: center;
    margin-bottom: 50rpx;
  }

  .fail {
    font-size: 36rpx;
    font-weight: 400;
    line-height: 52.13rpx;
    color: rgba(0, 0, 0, 1);
  }

  .btn {
    width: 380rpx;
    height: 90rpx;
  }
}

.content1 {
  background-image: url("https://travel20231111.oss-cn-hangzhou.aliyuncs.com/image/modal-bg-b1.png");
}
</style>
